package com.deyuanyun.pic.settings.controller.vo;

import com.deyuanyun.pic.settings.domain.prvlg.UserGroup;
import com.github.pagehelper.Page;

public class UserGroupVO extends SettingsBaseVO<UserGroup> {
    
    // 角色名称
    private String name;
    // 角色编号
    private String code;
    // 角色编号
    private String state;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Override
    public void fromDomain(UserGroup domain) {

        // 角色名称
        this.name = domain.getName();
        // 角色编号
        this.code = domain.getCode();
        // 角色编号
        this.state = domain.getState();

        super.fromDomain(domain.getId(), domain.getCreateRemark());
    }

    public Page<UserGroupVO> fromDomainList(Page<UserGroup> domainList) {
        Page<UserGroupVO> list = new Page<UserGroupVO>();
        for (UserGroup userGroup : domainList) {
            UserGroupVO userGroupVO = new UserGroupVO();
            userGroupVO.fromDomain(userGroup);
            list.add(userGroupVO);
        }
        converterPage(domainList, list);
        return list;
    }
}